package cn.web.tunnelrobot.voice;

import cn.web.tunnelrobot.voice.RtcTokenBuilder;
import cn.web.tunnelrobot.voice.RtcTokenBuilder.Role;

public class RtcTokenBuilderSample {
    static String appId = "6e808c6dbb3c469388bdcf5c531dacc0";
    static String appCertificate = "27f6f0a5173344caa4113b51a3e352c3";
    static String channelName = "1000";
    //static String userAccount = "2082341273";
    static int uid = 0;
    static int expirationTimeInSeconds = 3600;

    public static void main(String[] args) throws Exception {
        RtcTokenBuilder token = new RtcTokenBuilder();
        int timestamp = (int)(System.currentTimeMillis() / 1000 + expirationTimeInSeconds);
/*        String result = token.buildTokenWithUserAccount(appId, appCertificate,
        		 channelName, userAccount, Role.Role_Publisher, timestamp);
        System.out.println(result);*/

        String result = token.buildTokenWithUid(appId, appCertificate,
       		 channelName, uid, Role.Role_Publisher, timestamp);
        System.out.println("result+++:"+result);
    }

}
